﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SceneManager.Processors
{
    public class DefaultRenderGraph : RenderGraph
    {
        private NormalDepthColorProcessor normalDepthColorProcessor;
        private LightProcessor lightProcessor;
        private DefaultRenderProcessor defaultRenderProcessor;

        public DefaultRenderGraph(Game game, List<DrawableObject> objects, List<Light> lights, Color ambientLight)
        {
            // Processors
            Add("NormalDepthColor", normalDepthColorProcessor = new NormalDepthColorProcessor(game, objects));
            Add("Light", lightProcessor = new LightProcessor(game, lights, ambientLight));
            Add("Render", defaultRenderProcessor = new DefaultRenderProcessor(game));

            // Light
            Link("NormalDepthColor", "Normal", "Light", "Normal");
            Link("NormalDepthColor", "Depth", "Light", "Depth");
            Link("NormalDepthColor", "Color", "Light", "Color");

            // Render
            Link("NormalDepthColor", "Depth", "Render", "Depth");
            Link("NormalDepthColor", "Color", "Render", "Color");
            Link("Light", "Light", "Render", "Light");
        }
    }
}
